﻿#ifndef SEARCHFRIENDITEM_H
#define SEARCHFRIENDITEM_H

#include "servicetype.h"
#include <QWidget>
#include <QMouseEvent>

namespace Ui {
class SearchFriendItem;
}

class SearchFriendItem : public QWidget
{
    Q_OBJECT

public:
    explicit SearchFriendItem(ServiceType type,const QString &text,QWidget *parent = nullptr);
    explicit SearchFriendItem(const QString &email,const QString &username,QWidget *parent = nullptr);
    ~SearchFriendItem();
    void setNormalStyle();
    void setClickStyle();
    QString getEmail();
    void updateHeadImg();
signals:
    void clicked(SearchFriendItem* item);
    void onClicked(const QString &email);
protected:
    void mousePressEvent(QMouseEvent* event);
    void mouseDoubleClickEvent(QMouseEvent* event);
private:
    Ui::SearchFriendItem *ui;
    QString email;
};

#endif // SEARCHFRIENDITEM_H
